package com.hongxun.design.jungong.activity;

import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import com.hongxun.design.R;
import com.hongxun.design.activitys.BaseActivity;
import com.hongxun.design.jungong.fragment.FragmentColleagues;
import com.hongxun.design.mytools.MString;

/**
 * Created by Administrator on 2017/9/18.列表数据选择
 */

public class SelectRelatedActivity extends BaseActivity {
    private FragmentManager manager;
    private FragmentTransaction transaction;
    private FragmentColleagues fragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.selectrelated);
        manager = getSupportFragmentManager();
        transaction = manager.beginTransaction();
        getIntentData();
    }

    private void getIntentData() {
        Bundle bundle = getIntent().getExtras();
        switch (bundle.getString(MString.TYPENUM)) {
            case "3"://负责人
                fragment = new FragmentColleagues();
                if (!fragment.isAdded()) {
                    transaction.add(R.id.fragment_select, fragment, "1");
                } else {
                    transaction.show(fragment);
                }
                transaction.commit();
                fragment.Refresh();
                break;
            case "4"://参与人
                finish();
                break;
        }
    }
}
